# Contributor: Pedro Filipe <xpecex@outlook.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=netperf
pkgver=2.7.0
pkgrel=0
pkgdesc="TCP/UDP/sockets/etc performance benchmark"
url="http://www.netperf.org/netperf/"
arch="all"
license="custom"
subpackages="$pkgname-doc"
source="netperf-netperf-$pkgver.tar.gz::https://github.com/HewlettPackard/netperf/archive/netperf-$pkgver.tar.gz"
builddir="$srcdir/netperf-netperf-$pkgver"

build() {
	cd "$builddir"
	./configure --prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var
	make
}

check() {
	cd "$builddir"
	make check
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install
	install -d "$pkgdir"/usr/share/licenses/netperf
	install COPYING "$pkgdir"/usr/share/licenses/netperf/
}

sha512sums="f96426d1a76358ce4adee0e91cec246fe2584e135e12d47ccf712b8673debd1b37b339adcdea6e1edffc5fe535168ab1541926544d0eae5b9942498037985e33  netperf-netperf-2.7.0.tar.gz"
